<!--
	作者：weixin
	时间：2017-03-30
	描述：企业认证审核页面
-->
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>企业用户认证审核-后台管理系统</title>
		<link rel="stylesheet" href="${rc.contextPath}/bootstrap/css/bootstrap.css" />
		<link rel="stylesheet" href="${rc.contextPath}/zui/css/zui.css" />
		<script src="${rc.contextPath}/js/jquery.1.10.1.min.js"></script>
		<script type="text/javascript" src="${rc.contextPath}/zui/js/zui.js"></script>
	</head>

	<body>
		<ul class="nav nav-tabs" id="adminTab">
			<li>
				<a href="${rc.contextPath}/admin/index" data-togggle="tab">首页</a>
			</li>
			<li class="active">
				<a href="${rc.contextPath}/admin/erterprise_manage" data-togggle="tab">企业管理及审核</a>
			</li>
			<li>
				<a href="${rc.contextPath}/admin/forum_manage" data-togggle="tab">论坛管理</a>
			</li>
			<li>
				<a href="message.html" data-togggle="tab">消息</a>
			</li>
			<li class="pull-right">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown">
					<img src="${rc.contextPath}/img/leader_default.png" width="20px" />管理员<span class="caret"></span>
				</a>
				<ul class="dropdown-menu">
					<li>
						<a href="#">账号设置</a>
					</li>
					<li>
						<a href="#">退出</a>
					</li>
				</ul>
			</li>
		</ul>

		<!--  左侧菜单  -->
		<div style="margin-top: 20px;" class="col-xs-2">
			<nav class="menu" data-toggle="menu" style="width: 200px;">
				<ul class="nav nav-primary">

					<li class="active show nav-parent">
						<a href="javascript:;"><i class="icon icon-group"></i> 公司</a>
						<ul class="nav">
							<li>
								<a href="enterprise_manage.html" ><i class="icon icon-cog"></i> 公司信息管理</a>
							</li>
							<li>
								<a href="enterprise_check.html" >
									<i class="icon icon-trophy"></i> 公司认证审核<span class="label label-badge pull-right">5</span>
								</a>
							</li>
							<li class="active">
								<a href="${rc.contextPath}/admin/enterprise_user_check/1" >
									<i class="icon icon-trophy"></i> 企业用户审核<span class="label label-badge pull-right" id="uncheckUserCount">0</span>
								</a>
							</li>
							<li>
								<a href="javascript:;" th:href="@{/user/toBlogtypeManager}"><i class="icon icon-plus"></i> 添加公司</a>
							</li>
						</ul>
					</li>

					<li class="active show nav-parent">
						<a href="javascript:;"><i class="icon icon-book"></i> 招聘</a>
						<ul class="nav">
							<li>
								<a href="job_manage.html"><i class="icon icon-list-ul"></i> 招聘管理</a>
							</li>
							<li>
								<a href="javascript:;"><i class="icon icon-pencil"></i> 发布招聘</a>
							</li>
						</ul>
					</li>
				</ul>
			</nav>
		</div>

		<div class="col-xs-8" style="margin-top: 20px;">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<h3 class="panel-title">待审核</h3>
				</div>
				<div class="panel-body">
					<table class="table table-striped">
						<thead>
							<tr>
								<th>用户id</th>
								<th width="40%">用户绑定公司id</th>
								<th>请求时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							#foreach($!enterpriseUser in $!enterpriseUserList)
							<tr>
								<td>$!enterpriseUser.enterprise_user_id</td>
								<td>$!enterpriseUser.enterprise_company_id</td>
								<td>$!enterpriseUser.gmt_create</td>
								<td>
									<a href="#" data-toggle="modal" data-target="#checkUser" data-id="$!enterpriseUser.id">审核</a>&nbsp;&nbsp;
								</td>
							</tr>
							#end
						</tbody>
					</table>
				</div>
			</div>

		</div>


		<!--------------------------------------- 企业审核弹出对话框  ------------------------------------->
		<div class="modal fade" id="checkUser">
			<div class="modal-dialog">
				<form class="form-horizontal" action="#" id="checkForm">
				<input type="hidden" name="id" value=""/>
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
						<h4 class="modal-title">审核企业用户认证信息</h4>
					</div>
					<div class="modal-body">
						
							<div class="form-group">
								<label for="exampleInputAccount4" class="col-sm-2">审核材料</label>
								<div class="col-md-6 col-sm-10">
									<img class="img-thumbnail" src="../../img/logo_default.png" width="100px" id="show_checkfile"/>
								</div>
							</div>
							<div class="form-group">
								<label for="exampleInputAccount4" class="col-sm-2">用户id</label>
								<div class="col-md-6 col-sm-10">
									<span id="userid"></span>
									<input type="hidden" name="userid" value=""/>
								</div>
							</div>
							<div class="form-group">
								<label for="exampleInputPassword4" class="col-sm-2">用户昵称</label>
								<div class="col-md-6 col-sm-10">
									<span id="nickname">www.wetsion.site</span>
								</div>
							</div>
							<div class="form-group">
								<label for="exampleInputPassword4" class="col-sm-2">用户邮箱</label>
								<div class="col-md-6 col-sm-10">
									<span id="email">www.wetsion.site</span>
								</div>
							</div>
							<div class="form-group">
								<label for="exampleInputPassword4" class="col-sm-2">公司</label>
								<div class="col-md-6 col-sm-10">
									<span id="company_name">天津</span>
								</div>
							</div>
					</div>

					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<div class="btn-group">
						<input type="radio" name="status" value="1" />通过
						<br/>
						<input type="radio" name="status" value="0" />不通过
						<input type="text" name="sugestion" value="" placeholder="不通过理由"/>
						</div>
						<button type="button" class="btn btn-primary" id="tijiao">提交</button>
						<button type="reset" style="display: none;"></button>
					</div>
					
				</div>
				</form>
			</div>
		</div>
		<!--------------------------------------- end  ------------------------------------------------>

	</body>
	<script type="text/javascript">
	$('#checkUser').on('show.zui.modal', function (e) {
		console.log("aa");
		jQuery.getJSON("${rc.contextPath}/admin/queryEnterpriseUser?id="+$(e.relatedTarget).data("id"),function(data){
			$("input[name='id']").val(data.enterpriseUser.id);
			$("input[name='userid']").val(data.enterpriseUser.enterprise_user_id);
			$("#userid").html(data.user.id);
			$("#nickname").html(data.user.nickname);
			$("#email").html(data.user.email);
			$("#company_name").html(data.company.company_name);
			if(data.enterpriseUser.enterprise_checkfile!=null){
				$("#show_checkfile").attr("src","http://127.0.0.1:8080/image/checkfile/"+data.enterpriseUser.enterprise_checkfile);
			}
			
		});
	});
	$("#checkUser").on('hide.zui.modal',function(e){
		$("button[type='reset']").trigger("click");
	});
	$("#tijiao").click(function(){
		jQuery.post("${rc.contextPath}/admin/checkEnterpriseUser", $("#checkForm").serialize(), function(data) {
				(new jQuery.zui.ModalTrigger({
					custom : data.info
				})).show({hidden: function(){
					if(data.code == 200){
						location.reload();
						//window.location.href = "${rc.contextPath}/admin/addcompany";
					}
				}});
		}, 'json');
	});
	
	$(function(){
		jQuery.getJSON('${rc.contextPath}/admin/getUncheckEnterpriseUserCount',function(data){
			if(data!=0){
				$("#uncheckUserCount").html(data);
			}
		})
	});
	</script>
</html>
